{% set nodeTag = "v1.19.11" -%}
{% if ip_family is equalto "dual" -%}
  {% set nodeTag = "v1.21.2" -%}
{% endif -%}
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
  kubeProxyMode: {{ kube_proxy_mode }}
  disableDefaultCNI: true
  ipFamily: {{ ip_family }}
  apiServerAddress: 127.0.0.1
kubeadmConfigPatches:
  - |
    kind: ClusterConfiguration
    metadata:
      name: config
    etcd:
      local:
        dataDir: "/tmp/lib/etcd"

nodes:
  - role: control-plane
    image: kindest/node:{{ nodeTag }}
  {%- if ha is equalto "true" %}
  - role: control-plane
    image: kindest/node:{{ nodeTag }}
  - role: control-plane
    image: kindest/node:{{ nodeTag }}
  {%- elif single is equalto "true" %}

  {%- else %}
  - role: worker
    image: kindest/node:{{ nodeTag }}
  {%- endif %}
